#导入Flask类，该类的实例将会成为我们的WSGI应用
from flask import Flask
from flask import request
from vault.vault_builder import make_list

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/vault/makelist', methods=['GET'])
def make_list_route():
    vault_root_folder_path = "E:/WebArchivesVault"
    bookmarks_file_path = "E:/Bookmarks.html"
    try:
        make_list(vault_root_folder_path, bookmarks_file_path)
        return "success"
    except Exception as err:
        return f"error: {err}"

if __name__ == "__main__":
    app.run(host='127.0.0.1', port=8080)